package com.ruge.user.error;

import com.ruge.core.exception.IError;
import lombok.AllArgsConstructor;

/**
 * @author ruge.wu
 * @since 2021/12/21 14:49
 */
@AllArgsConstructor
public enum UserError implements IError {
    USER_HAS_SIGN("0001", "今日已完成签到,无需重复签到!"),
    MOBILE_HAS_REGISTER("0002", "手机号已注册,请登录!"),
    USER_HAS_REGISTER("0003", "手机号已注册,请登录!"),
    NO_FOLLOW_RECORD("0004", "没有关注记录,请重试!"),
    NO_NEED_REPEAT_FOLLOW("0005", "无需重复关注,请刷新!"),
    BLOG_NOT_EXIST("0005", "博客不存在,请刷新!"),
    INTEGRAL_RULE_NOT_EXIST("0006", "积分规则不存在 请联系管理员!"),
    LOCATION_NOT_ENABLED("0006", "用户未开启定位权限!"),
    ;

    private static final String NAME_SPACE = "USER";

    private String errorCode;
    private String errorMessage;

    @Override
    public String getNamespace() {
        return NAME_SPACE;
    }

    @Override
    public String getErrorCode() {
        return NAME_SPACE + "." + errorCode;
    }

    @Override
    public String getErrorMessage() {
        return errorMessage;
    }
}
